﻿
@{ 
    var user = (Wei.Model.User_Model)Session["User_Info"];
   
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="~/wei.ico" type="image/x-icon" />
    <title>@ViewBag.Title</title>
    <link href="~/Content/layui/css/layui.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/public.js"></script>
    <script src="~/Content/layui/layui.all.js"></script>
    <style>
        .right1 {
            float: right;
            height: 60px;
        }

        .footer {
            border-top: 1px solid #e2e2e2;
            margin-top: 20px;
            margin: 10px;
        }

        .youqing {
            background: #FFF;
            padding: 10px;
            box-shadow: 0px 0px 20px #dedede;
        }

        .youqing-list {
            padding: 10px;
        }

            .youqing-list li {
                float: left;
                padding: 10px;
            }

        .yinyue {
            width: 200px;
            height: 200px;
            background-color: #eeeeee;
            position: fixed;
            top: 700px;
            right: 100px;
            border:0px;
        }
    </style>
</head>
<body style="background: #eee;">
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md12">

                <ul class="layui-nav layui-bg-green">
                    <li class="layui-nav-item"><a style="font-size: 22px;" href="/Home/Index">二维也</a></li>
                    <li class="layui-nav-item"><a href="/Home/Index">首页</a></li>
                    <li class="layui-nav-item"><a href="/Crawl/Index">看小说</a></li>
                    <li class="layui-nav-item layui-hide"><a href="/Admin/Home/Index" target="_blank">后台看看</a></li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">其他内容</a>
                        <dl class="layui-nav-child">
                            <dd><a href="###">待定1</a></dd>
                            <dd><a href="###">待定2</a></dd>
                            <dd><a href="###">待定3</a></dd>
                        </dl>
                    </li>
                    @if (user == null)
    {
                <li class="layui-nav-item right1"><a href="/Home/Login">登录</a></li>
                <li class="layui-nav-item right1"><a href="/Home/Register">注册</a></li>
}
else
{
                <li class="layui-nav-item right1"><a href="/Home/LoginOut">注销</a></li>
                <li class="layui-nav-item right1">
                    <a href="javascript:;">
                        <img src="@user.u_img" id="top_user_img" class="layui-nav-img" />
                        您好：@user.u_name
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/User/User_Manager">用户中心</a></dd>
                        <dd><a href="###">安全设置</a></dd>
                    </dl>
                </li>
}

                    <li class="layui-nav-item right1">
                        <div class="layui-inline">
                            <button class="layui-btn" onclick="Search_Center()">
                                <i class="layui-icon">&#xe615;</i> 搜索
                            </button>
                        </div>
                    </li>

                    <li class="layui-nav-item right1">
                        <div class="layui-input-inline">
                            <input type="text" style="width:300px;" id="s_title" name="s_title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
                        </div>
                    </li>
                </ul>
            </div>

        </div>
        <!-- 内容主体区域 -->
        @RenderBody()

        @if (Session["sy_show_friend_link"] != null)
        {
            if (Session["sy_show_friend_link"].ToString() == "是")
            {
            <!--标签类别的部分页-->
            @Html.Action("Friend_Link_Link_List", "Home")
            }
        }
        <div class="layui-row">
            <div class="footer">
                <div class="container clearfix" style="text-align:center">
                    版权 www.chenjinwei.com 二维也. 备案号：粤ICP备16014691号-1
                </div>

            </div>
        </div>
        @*<div class="yinyue">
            <iframe src="~/music/music.html" width="200" height="200" frameborder="0"></iframe>
        </div>*@
        <audio id="myaudio" controls="controls" style="display:none;">
            <source src="" loop="true" hidden="true" type="audio/mpeg" />
        </audio>
    </div>
    <script>
        var isplay = false;
        //JavaScript代码区域
        ; !function () {
            var layer = layui.layer
                , element = layui.element
                , form = layui.form;
            element.render();
            form.render();


            var util = layui.util;
            var arr = ['/music/Beyond.mp3', '/music/guxiang.mp3', '/music/Three_Little_Birds.mp3'];
            //监听音乐播放结束事件
            document.getElementById('myaudio').addEventListener('ended', function () {
                var myAuto = document.getElementById('myaudio');
                var index = Math.floor(Math.random() * 3);
                myAuto.src = arr[index];
                myAuto.play();
            }, false);

            //固定块
            util.fixbar({
                bar1: '&#xe652;'
                , bar2: '&#xe643;'
                , css: { right: 50, bottom: 100 }
                , bgcolor: '#393D49'
                , click: function (type) {
                    if (type === 'bar1') {
                        var myAuto = document.getElementById('myaudio');
                        this.innerHTML = "";
                        
                        var index = Math.floor(Math.random() * 3);
                        if (isplay) {
                            if (myAuto.paused) {
                                $(this).removeClass('layui-icon layui-icon-play');
                                $(this).addClass('layui-icon layui-icon-pause');
                                myAuto.play();
                            } else {
                                $(this).removeClass('layui-icon layui-icon-pause');
                                $(this).addClass('layui-icon layui-icon-play');
                                myAuto.pause();
                            }
                        } else {
                            isplay = true;
                            $(this).removeClass('layui-icon layui-icon-play');
                            $(this).addClass('layui-icon layui-icon-pause');
                            myAuto.src = arr[index];
                            myAuto.play();
                        }
                    } else if (type === 'bar2') {
                        isplay = false;
                        var myAuto = document.getElementById('myaudio');
                        myAuto.currentTime = 0;
                        myAuto.pause();
                        $(this).prev().text("");
                        $(this).prev().removeClass('layui-icon layui-icon-pause');
                        $(this).prev().removeClass('layui-icon layui-icon-play');
                        $(this).prev().addClass('layui-icon layui-icon-play');
                    }
                }
            });

        }();

        function Search_Center() {
            var title = $("#s_title").val();
            if (title == "") {
                layer.msg("请输入搜索内容");
                return;
            }
            location.href = "/Home/Content_List?key=" + title;
        }




    </script>
</body>

</html>